﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;
namespace HFWebApp.delegates
{
	public partial class delegatelist : BagePages
	{
        public string PageString = "";
		protected void Page_Load(object sender, EventArgs e)
		{
            if (!Page.IsPostBack)
            {
                int PageSize = 7;
                int PageNumber = 1;
                if (this.GetQuery("Page") != "")
                {
                    PageNumber = int.Parse(this.GetQuery("Page"));
                }
                int total = 0;
                string strWhere = "isCheck = 1";

                    string keyword = this.GetAll("keyword");
                    if (keyword != "")
                    {
                        strWhere = strWhere + " and DelegateName like '%" + keyword + "%'";
                    }
                    string provinceid = this.GetAll("provinceid");
                    if (provinceid != "" )
                    {
                        if (provinceid != "0")
                        {
                            strWhere = strWhere + " and ProvinceID=" + provinceid;
                        }
                    }
                    string cityid = this.GetAll("cityid");
                    if (cityid != "")
                    {
                        if (cityid != "0")
                        {
                            strWhere = strWhere + " and CityID =" + cityid;
                        }
                    }
                

                Repeater1.DataSource = DelegateController.getController().getCaseDelegateList(PageSize, PageNumber, strWhere, out total);
                Repeater1.DataBind();
                PageString = LLL.Pager.TrunPageHtmlCode_Web(PageSize, PageNumber, total, "");
            }
		}
	}
}